#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>

using namespace std;

class Solution {
public:
    vector<int> sortArray(vector<int>& nums) {

        qsort(nums, 0, nums.size() - 1);

        return nums;
    }

    int getRand(vector<int>& nums, int left, int right)
    {
        return nums[rand() % (right - left + 1) + left];
    }

    void qsort(vector<int>& nums, int l, int r)
    {
        if (l >= r)
            return;
        int key = getRand(nums, l, r);
        int i = l, left = l - 1, right = r + 1;
        while (i < right)
        {
            if (nums[i] < key)
                swap(nums[i++], nums[++left]);
            else if (nums[i] > key)
                swap(nums[i], nums[--right]);
            else
                i++;
        }
        qsort(nums, l, left);
        qsort(nums, right, r);
    }
};

int main()
{

	return 0;
}